package routers

import (
	"github.com/astaxie/beego"
	"qinnailin.cn/myblog/controllers/admin"
	"qinnailin.cn/myblog/controllers/article"
	"qinnailin.cn/myblog/controllers/home"
)

func init() {
	beego.Router("/", &home.HomeController{}, "*:Index")
	beego.Router("/about", &home.HomeController{}, "*:About")
	beego.Router("/regedit", &home.HomeController{}, "get:Regedit;post:DoRegedit")
	beego.Router("/login", &home.HomeController{}, "get:Login;post:DoLogin")
	beego.Router("/loginout", &home.HomeController{}, "*:LoginOut")
	beego.Router("/article/:id:string", &article.ArticleController{}, "*:Detail")
	beego.Router("/article", &article.ArticleController{}, "*:Index")

	//admin页面

	beego.Router("/admin", &admin.AdminController{}, "*:Index")
	beego.Router("/article/edit", &admin.AdminController{}, "get:ArticleEdit;post:DoArticleEdit") //get 和post分别调用不同的方法
}
